<?php
/**
 * Modify Screen for Contact Source
 * 
 */

use Fox\Html\DropList;
use Fox\Html\CheckBox;
use Fox\Html\Input;
use Fox\Generator;
use Hive\Contact\Status;
use Fox\Popup\Modify;

$area = Xview::instance()->val('area');
if(empty($area)) {
	$callback = Generator::ajaxReload('contentCol');
} elseif($area == 'contact-create') {
	$callback = Generator::ajaxReload('status');
}

$popup = new Modify('pStatus',
					Status::className(),
					array(Hive::BUNDLE,Hive::ADD_A_NEW_STATUS),
					null,
					null,
					null,
					null,
					null,
					$callback
				);
$popup->block()
		->add(new Input('label',true))->parentObject()
		->add(new DropList('type',true,false,true))
			->options(Hive\Contact\Status\Type::loadActives(),'type',Generator::call('label'))
			->parentObject()
		->add(new CheckBox('active',true))->parentObject()
		->add(new Input('language',true,Xview::instance()->language()))->hidden()->parentObject()
		->add(new Input('standard',true,0))->hidden();			
return $popup->display();